package com.liuzhilong.infrastructure.middleware.elasticsearch.repository;

import com.liuzhilong.infrastructure.middleware.elasticsearch.entity.Book;

import java.util.List;

/**
 * 书籍信息的仓储类
 */
public interface BookRepository {
    public String newBook(Book book);
    public void update(Book book);
    public Book load(String id);
    public List<Book> search(Book book);
    /**
     * 滚动查询
     * @param book
     * @param size
     * @return
     */
    public List<Book> scroll(Book book,int size);

    /**
     * 下一次滚动
     * @param scrollId  滚动id
     * @param nextId 下一个id
     * @param size 大小
     * @return
     */
    public List<Book> scroll(String scrollId,String nextId,int size);


}
